package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Role;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    /**
     * 分页
     * @param qo 查询参数
     */
    int queryForCount(QueryObject qo);

    List<Role> queryForList(QueryObject qo);

    /**
     * 维护关系
     * @param id
     */
    void deleteRelation(Long id);

    void saveRelation(@Param("roleId") Long id, @Param("permissionId") Long id1);

    List<Long> getRoleIdsByEmployeeId(Long id);

    List<String> getRoleSnByEmployeeId(Long id);
}